﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TowerCK : Tower
{
	public override void FindAttackTarget() {
		// base.FindAttackTarget();
		Enemy[] enemies = EnemyController.Singleton.GetEnemyInRange(
					new Vector3(transform.position.x, 0, transform.position.z),
					range
				);

		if (enemies.Length > 0) {
			int index = 0;
			for (int i = 0; i < enemies.Length; i++) {
				if (enemies[i].blood < enemies[index].blood)
					index = i;
			}
			attackTarget = enemies[index].transform;
		} else {
			attackTarget = null;
		}
	}
}
